package com.android.ailaoshan.location;

import android.content.Context;
import android.location.LocationManager;

/**
 * 检查位置提供器是否可用
 */
public class CheckGPS {
    public static boolean check(Context context){
        LocationManager locationManager = (LocationManager)
                context.getSystemService(Context.LOCATION_SERVICE);
        boolean gps = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
        boolean network = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER);

        return (gps || network);
    }
}
